import React from 'react'
import {render} from 'react-dom'
import { createStore, applyMiddleware, compose } from 'redux'
import thunk from 'redux-thunk'
// import { counter, addAction, cutAction, addActionAsync } from './store'
import { counter } from './store'
import App from './App'
import { Provider } from 'react-redux'

const reduxDevtools = window.devToolsExtension ? window.devToolsExtension() : () => {} // function

const store = createStore(counter, compose(applyMiddleware(thunk), reduxDevtools))

render(<Provider store={store} >
  <App />
</Provider>, document.getElementById('root'))

// function renderEle() {
//   render(<App store={store} add={addAction} cut={cutAction} addAsync={addActionAsync} />, document.getElementById('root'))
// }
// renderEle()

// store.subscribe(renderEle)